<template>
  <!-- 告警处理 -->
  <BaseMainSlot>
    <template v-slot:btn-box>
      <!-- <SelectButton
        :buttonselectlist="selectbutlist"
        @nowselectbuttonindex="gettabletype"
      /> -->
      <ActionBar
        v-if="nowselecttype === 0"
        :page-no="21"
        :add-active="addActive"
        :del-active="delActive"
        :cancel-active="cancelActive"
        :save-active="saveActive"
        :has-cancel="false"
        :has-save="false"
        :has-add="false"
        :has-del="false"
        :has-edit="false"
        :disposeFlag="disposeFlag"
        :has-edit-column="true"
        @showColumn="showColumn"
        @dispose="disposed"
        @add="add"
        @cancel="cancel"
        @del="del"
      />
      <ActionBar
        v-else
        :page-no="297"
        :has-add="false"
        :has-edit="false"
        :has-cancel="false"
        :has-edit-column="true"
        :has-export="true"
        @showColumn="showColumn"
        @download="download"
      />
    </template>
    <template v-slot:search-box>
      <SearchForm
        :formConfig="formConfig"
        :formData="searchlist"
        @search="search"
      ></SearchForm>
    </template>
    <template v-slot:table-box>
      <Table
        v-if="nowselecttype === 0"
        @sortChange="changeTableSort"
        :propList="tableColumn"
        v-loading="loading"
        :listData="tableData"
        :showSelectColumn="false"
        @handleSelectionChange="handleSelectionChange"
      >
        <template v-slot:operation="{ row }">
          <template v-if="!row.index">
            <el-button
              v-if="row.alarmMessageId"
              type="success"
              plain
              size="small"
              @click="getalrmmessage(row)"
              >查看详情</el-button
            >
            <el-button
              v-if="row.dataItemName && judgePermission(18, 'handle')"
              type="success"
              plain
              size="small"
              @click="handlingmmessage(row)"
              >处理</el-button
            >
          </template>
        </template>
        <template v-slot:disposeStatus="{ row }">
          <template v-if="!row.index">
            <div
              :style="{
                color: row.disposeStatus === true ? '#5cb87a' : '#f56c6c',
              }"
            >
              {{ filtername(row.disposeStatus) }}
            </div>
          </template>
        </template>
        <template v-slot:lookFacilityList="{ row }">
          <template v-if="!row.index">
            <el-button
              class="text-btn-cursor"
              type="text"
              size="small"
              @click="lookFacilityList(row)"
            >
              <i class="el-icon-view"></i> 查看
            </el-button>
          </template>
        </template>
      </Table>
      <Table
        v-else
        @sortChange="changeTableSort"
        :propList="tableColumn"
        v-loading="loading"
        :listData="tableData"
        :showSelectColumn="false"
        @handleSelectionChange="handleSelectionChange"
      >
        <template v-slot:operation="{ row }">
          <template v-if="!row.index">
            <el-button
              v-if="row.alarmMessageId"
              type="success"
              plain
              size="small"
              @click="getalrmmessage(row)"
              >查看详情</el-button
            >
          </template>
        </template>
        <template v-slot:disposeStatus="{ row }">
          <template v-if="!row.index">
            <div
              :style="{
                color: row.disposeStatus === true ? '#5cb87a' : '#f56c6c',
              }"
            >
              {{ filtername(row.disposeStatus) }}
            </div>
          </template>
        </template>
        <template v-slot:lookFacilityList="{ row }">
          <template v-if="!row.index">
            <el-button
              class="text-btn-cursor"
              type="text"
              size="small"
              @click="lookFacilityList(row)"
            >
              <i class="el-icon-view"></i> 查看
            </el-button>
          </template>
        </template>
      </Table>
      <Pagination
        :page-size="pageSize"
        :current-page="currentPage"
        :total-size="totalSize"
        @changePageSize="changePageSize"
        @changeCurrentPage="changeCurrentPage"
      />
    </template>
    <template v-slot:dialog>
      <el-dialog
        title="处理结果"
        label-position="left"
        :visible.sync="dialogVisible"
        @close="cancel"
      >
        <el-form ref="form" label-width="80px">
          <el-form-item label="处理结果:" class="w100p">
            <el-select
              v-model="defaulthandindex"
              width="100%"
              @change="defaulthandmet"
            >
              <el-option
                v-for="(deaitem, deaindex) in defaulthandinglist"
                :key="deaindex"
                :value="deaindex"
                :label="deaitem"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="处理意见:" class="w100p">
            <el-autocomplete
              type="textarea"
              style="width: 100%"
              v-model="formData.disposeContent"
              :fetch-suggestions="querySearch"
              placeholder="请输入处理意见"
              @select="handleSelect"
            ></el-autocomplete>
          </el-form-item>
          <el-form-item
            class="w100p red"
            label="温馨提示：你可以将处理意见设为模板，以便下次处理！"
          >
            <!-- 设为模板 -->
            <el-button
              type="success"
              :disabled="!formData.disposeContent"
              @click="setTemplate"
              style="margin: 0 auto"
              plain
              >设为模板</el-button
            >
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button class="zh-button-one" @click="cancel">取 消</el-button>
          <el-button class="zh-button-two" type="primary" @click="clickqueren"
            >确 定</el-button
          >
        </span>
      </el-dialog>
      <el-dialog
        id="tableColumnDialog"
        title="配置列"
        :visible.sync="dialogTableColumnVisible"
      >
        <tableColumn
          v-if="dialogTableColumnVisible"
          ref="tableColumn"
          :tableColumn="allTableColumn"
          @cancelColumn="cancelColumn"
        />
        <div slot="footer" class="dialog-footer">
          <el-button
            class="zh-button-one"
            @click="dialogTableColumnVisible = false"
          >
            取 消
          </el-button>
          <el-button class="zh-button-two" type="primary" @click="saveColumn">
            保 存
          </el-button>
        </div>
      </el-dialog>
      <SeeEquip
        :is-show-equip="isShowEquip"
        :equip-data="facilityBOList"
        @closeDialog="isShowEquip = false"
      />
    </template>
  </BaseMainSlot>
</template>
<script>
import SeeEquip from "@/components/seeEquip/index.vue";
import historicalAlarmRecord from "@/views/digital-production/monitoring-alarmManagement/historical-alarm-record/index";
import SearchForm from "@/components/searchForm";
import Table from "@/components/table/table.vue";
import ActionBar from "@/components/ActionBar";
import nowpagereqs from "@/api/digital-production/monitoring-alarm/alarm-category-management";
import Pagination from "@/components/Pagination";
import userreq from "@/api/user/index";
import SelectButton from "@/components/selectbutton/index.vue";
import nowpagereq from "@/api/digital-production/monitoring-alarm/historical-alarm-record/index";
import BaseMainSlot from "@/components/BaseMainSlot/newBaseMainSlot.vue";
import alarmNowpagereq from "@/api/digital-production/monitoring-alarm/alarm-category-management/index";
import { mymixin } from "@/utils/mixin";
import * as echarts from "echarts";

import { mapGetters } from "vuex";
// import historicalAlarmRecord from '@/api/digital-production/monitoring-alarm/historical-alarm-record/index';
export default {
  name: "AlarmHandling",
  components: {
    SearchForm,
    Table,
    Pagination,
    BaseMainSlot,
    SelectButton,
    ActionBar,
    historicalAlarmRecord,
    SeeEquip,
  },
  mixins: [mymixin],
  data() {
    return {
      isShowEquip: false,
      facilityBOList: [], //设施列表
      tableColumn: [
        { prop: "batchName", label: "批次名称", minWidth: "300" },
        {
          prop: "lookFacilityList",
          label: "设施列表",
          slotName: "lookFacilityList",
          minWidth: "180",
        },
        { prop: "baseAlarmName", label: "告警名称", minWidth: "300" },
        { prop: "dataItemName", label: "告警数据项", minWidth: "150" },
        { prop: "alarmPresetValue", label: "预设告警值", minWidth: "130" },
        { prop: "actualAlarmValue", label: "实际告警值", minWidth: "130" },
        { prop: "generateTime", label: "发生时间", minWidth: "180" },
        { prop: "dataTypeName", label: "告警数据类型", minWidth: "150" },
        {
          prop: "disposeStatus",
          label: "告警信息状态",
          slotName: "disposeStatus",
          minWidth: "150",
        },
        { prop: "disposeContent", label: "处理意见", minWidth: "180" },
        {
          prop: "operation",
          label: "操作",
          slotName: "operation",
          minWidth: "180",
        },
      ],
      tableColumn1: [
        { prop: "batchName", label: "批次名称", minWidth: "300" },
        {
          prop: "lookFacilityList",
          label: "设施列表",
          slotName: "lookFacilityList",
          minWidth: "180",
        },
        { prop: "baseAlarmName", label: "告警名称", minWidth: "300" },
        { prop: "dataItemName", label: "告警数据项", minWidth: "150" },
        { prop: "alarmPresetValue", label: "预设告警值", minWidth: "130" },
        { prop: "actualAlarmValue", label: "实际告警值", minWidth: "130" },
        { prop: "generateTime", label: "发生时间", minWidth: "180" },
        { prop: "dataTypeName", label: "告警数据类型", minWidth: "150" },
        {
          prop: "disposeStatus",
          label: "告警信息状态",
          slotName: "disposeStatus",
          minWidth: "150",
        },
        { prop: "disposeContent", label: "处理意见", minWidth: "180" },
        {
          prop: "operation",
          label: "操作",
          slotName: "operation",
          minWidth: "180",
        },
      ],
      tableColumn2: [
        { prop: "batchName", label: "批次名称", minWidth: "300" },
        {
          prop: "lookFacilityList",
          label: "设施列表",
          slotName: "lookFacilityList",
          minWidth: "180",
        },
        { prop: "baseAlarmName", label: "告警名称", minWidth: "300" },
        { prop: "dataItemName", label: "告警数据项", minWidth: "150" },
        { prop: "alarmPresetValue", label: "预设告警值", minWidth: "130" },
        { prop: "actualAlarmValue", label: "实际告警值", minWidth: "130" },
        { prop: "generateTime", label: "发生时间", minWidth: "180" },
        { prop: "dataTypeName", label: "告警数据类型", minWidth: "150" },
        {
          prop: "disposeStatus",
          label: "告警信息状态",
          slotName: "disposeStatus",
          minWidth: "150",
        },
        { prop: "disposeTime", label: "处理时间", minWidth: "180" },
        { prop: "disposeContent", label: "处理意见", minWidth: "180" },
        {
          prop: "operation",
          label: "操作",
          slotName: "operation",
          minWidth: "120",
        },
      ],
      formConfig: [
        {
          label: "选择批次",
          prop: "batchNo",
          type: "select",
          options: [], // batchList
          optionKey: { label: "batchName", value: "batchNo" },
        },
        {
          label: "设施名称",
          prop: "facilityNo",
          type: "select",
          options: [], // facilityList
          optionKey: { label: "facilityName", value: "facilityNo" },
        },
        {
          label: "告警数据类型",
          prop: "alarmTypeId",
          type: "select",
          options: [], // alarmTypeList
          optionKey: { label: "alarmTypeName", value: "alarmTypeId" },
        },
        {
          label: "数据类型",
          prop: "dataTypeId",
          type: "select",
          options: [], // dataTypeList
          optionKey: { label: "dataTypeName", value: "dataTypeId" },
        },
        {
          label: "选择数据项",
          prop: "dataItemId",
          type: "select",
          options: [], // dataitemlist
          optionKey: { label: "originalName", value: "dataItemId" },
        },
        {
          label: "选择时间",
          prop: "date",
          type: "daterange",
          format: "yyyy-MM-dd HH:mm:ss",
        },
      ],
      editLists: false, //用于判断是否是批量处理
      disposeList: [],
      disposeFlag: true,
      dispose: true,
      dialogVisiblethree: false,
      // 可选择数据类型
      dataTypeList: [],
      // 可选择批次
      batchList: [],
      // 前后一小时数据
      dialogVisibletwo: false,
      echartlist: {
        xAxisdata: [],
        xData: ["前后一小时数据"],
        seriesData: [],
      },
      nowwarringmessage: {},
      // -----------
      defaulthandinglist: ["已处理完成", "忽略", "其他"],
      defaulthandindex: 0,
      dialogVisible: false,
      nowselecttype: 0, // 0为物联自动告警 2为手动记录告警 1为数值告警
      dataitemlist: [],
      searchlist: {
        dataItemId: "",
        date: "",
      },
      // 选择类型
      selectbutlist: [{ name: "待处理" }, { name: "已处理" }],
      // 选中的数据项数组 employeeId组成 (此数组最多为一个)
      nowselectedList: [],
      // 可选择所有地块
      alarmTypeList: [],
      // 设施
      facilityList: [],
      facilityNo: "",
    };
  },
  computed: {
    ...mapGetters({
      judgePermission: "permission/judgePermission",
    }),
  },
  watch: {},
  created() {},
  mounted() {
    this.getselecltlist();
    this.getTableDataList();
  },
  methods: {
    // 获取不同类型的表格数据
    gettabletype(i) {
      this.tableData = []
      this.currentPage = 1;
      this.nowselecttype = i;
      if (i === 0) {
        this.tableColumn = this.tableColumn1;
      } else {
        this.tableColumn = this.tableColumn2;
      }
      this.getTableDataList()
    },
    // 查询模板
    async queryTemplate(e) {
      this.templateType = e.dataTypeName;
      let params = {
        url: this.$route.path,
        organizationNo: sessionStorage.getItem("organizationNo"),
        type: e.dataTypeName,
      };
      let res = await alarmNowpagereq.queryTemplate(params);
      if (res.code === 1) {
        this.templateList = res.data;
        this.templateList.forEach((el) => {
          el.value = el.content;
        });
      }
    },
    querySearch(queryString, cd) {
      cd(this.templateList);
    },
    // TODO: 设为模板
    async setTemplate() {
      let params = {
        url: this.$route.path,
        account: sessionStorage.getItem("account"),
        organizationNo: sessionStorage.getItem("organizationNo"),
        type: this.templateType,
        content: this.formData.disposeContent,
      };
      let res = await alarmNowpagereq.setTemplate(params);
      if (res.code === 1) {
        this.$message.success("设置模板成功！");
      } else if (res.msg === "该处理意见已存在！") {
        this.$message.error("该模板已存在！");
      } else {
        this.$message.error("设置模板失败！");
      }
    },
    // 排序模板
    async handleSelect(e) {
      await alarmNowpagereq.sortTemplate(e.processContentId);
    },
    querySearch(queryString, cd) {
      cd(this.templateList);
    },
    changeTableSort(column) {
      this.sortList = column.order
        ? [
            {
              property: column.prop,
              direction: column.order == "ascending" ? "asc" : "desc",
            },
          ]
        : [];
      this.getTableDataList();
    },
    // 表格中的标签
    filterTag(value, row) {
      return row.disposeStatus === value;
    },
    // 表格中的标签
    filtername(value) {
      if (value) {
        return "已处理";
      } else {
        return "待处理";
      }
    },
    // 处理
    async handlingmmessage(e) {
      // TODO: 查询模板
      await this.queryTemplate(e);
      this.formData = {};
      this.dialogVisible = true;
      if (this.nowselecttype === 1) {
        if (e.numericalAlarmMessageId) {
          this.formData.numericalAlarmMessageId = e.numericalAlarmMessageId;
        }
      }
      if (this.nowselecttype === 0) {
        if (e.alarmMessageId) {
          this.formData.alarmMessageId = e.alarmMessageId;
        }
      }
    },
    // 默认处理意见
    defaulthandmet(i) {
      if (i === 0) {
        this.formData.disposeStatus = true;
      } else if (i === 1) {
        this.formData.disposeStatus = false;
      } else if (i === 3) {
        this.formData.disposeStatus = true;
      }
    },
    // 点击弹框确认-批量处理
    // 点击弹框确认
    async clickqueren() {
      this.dialogVisible = false;
      this.formData.disposeTime = this.dateToFormat(new Date());
      if (this.defaulthandindex == 0) {
        this.formData.disposeStatus = true;
      } else {
        this.formData.disposeStatus = true;
      }
      if (!this.formData.disposeContent) {
        this.formData.disposeContent = "";
      }
      console.log(this.formData, this.editLists);
      // TODO:批量处理
      if (this.editLists) {
        let params = [];
        this.disposeList.map((el) => {
          params.push({
            alarmMessageId: el.alarmMessageId,
            disposeStatus: this.formData.disposeStatus,
            disposeContent: this.formData.disposeContent,
            disposeTime: this.dateToFormat(new Date()),
          });
        });
        console.log(params, "批量处理");
        let res = await nowpagereq.editlists(params);
        if (res.code === 1) {
          this.getTableDataList();
          this.$message.success("批量处理成功");
          this.resetTable();
        } else {
          this.$message.error("批量处理失败");
        }
        return;
      } else {
        //单个处理
        console.log("单个处理");
        nowpagereq.editlist(this.formData).then((res) => {
          if (res.code === 1) {
            this.getTableDataList();
            this.$message.success("处理成功");
          } else {
            this.$message.error("处理失败");
          }
        });
      }
    },
    // 查看详细数据
    getalrmmessage(e) {
      this.$alert(e.message, "详细数据", {
        showConfirmButton: false,
        closeOnClickModal: true,
        confirmButtonClass: "zh-button-two",
      }).catch((_) => {});
    },
    // 获取前一小时数据
    getbeforertime(originDate) {
      const dt = new Date(originDate);
      const y = dt.getFullYear();
      const m = (dt.getMonth() + 1 + "").padStart(2, "0");
      const d = (dt.getDate() + "").padStart(2, "0");
      const hh = (dt.getHours() - 1 + "").padStart(2, "0");
      const mm = (dt.getMinutes() + "").padStart(2, "0");
      const ss = (dt.getSeconds() + "").padStart(2, "0");
      return `${y}-${m}-${d} ${hh}:${mm}:${ss}`;
    },
    // 获取后一小时数据
    getaftertime(originDate) {
      const dt = new Date(originDate);
      const y = dt.getFullYear();
      const m = (dt.getMonth() + 1 + "").padStart(2, "0");
      const d = (dt.getDate() + "").padStart(2, "0");
      const hh = (dt.getHours() + 1 + "").padStart(2, "0");
      const mm = (dt.getMinutes() + "").padStart(2, "0");
      const ss = (dt.getSeconds() + "").padStart(2, "0");
      return `${y}-${m}-${d} ${hh}:${mm}:${ss}`;
    },
    // 布尔值格式化
    formatBoolean(row, column, cellValue) {
      var ret = ""; // 你想在页面展示的值
      if (cellValue) {
        ret = "已处理"; // 根据自己的需求设定
      } else if (cellValue === false) {
        ret = "待处理";
      }
      return ret;
    },
    // 获取下拉选择数据
    getselecltlist() {
      // 获取所有监测数据项
      nowpagereq.getdataitemlist().then((res) => {
        this.dataitemlist = res.data;
        this.formConfig[4].options = res.data;
      });
      let params = {
        organizationList: sessionStorage
          .getItem("organizationList")
          .split(",")
          .concat([sessionStorage.parentId || ""]),
        farmingTypeNo: sessionStorage.getItem("farmingTypeNo"),
      };
      // 获取设施
      userreq.getfacilityAll(params).then((res) => {
        this.facilityList = res.data;
        this.formConfig[1].options = res.data;
      });
      // 获取批次
      let batchListParams = {
        simpleData: true
      }
      nowpagereq.getbatchlist(batchListParams).then((res) => {
        this.batchList = res.data;
        this.formConfig[0].options = res.data;
      });
      alarmNowpagereq.getalldatalist().then((res) => {
        this.dataTypeList = res.data;
        this.formConfig[3].options = res.data;
      });
      let faciparams = {
        organizationList: sessionStorage
          .getItem("organizationList")
          .split(",")
          .concat([sessionStorage.parentId || ""]),
        farmingTypeNo: sessionStorage.getItem("farmingTypeNo"),
      };
      nowpagereqs.querybycondition(faciparams).then((res) => {
        this.alarmTypeList = res.data;
        this.formConfig[2].options = res.data;
      });
    },
    getTableDataListtwo() {
      this.loading = true;
      let searchparam = {};
      if (this.searchlist.date && this.searchlist.date[0]) {
        searchparam.startTime = this.dateToFormat(this.searchlist.date[0]);
      }
      if (this.searchlist.date && this.searchlist.date[1]) {
        searchparam.endTime = this.dateToFormat(this.searchlist.date[1]);
      }
      searchparam.category = this.searchlist.category || undefined;
      searchparam.batchNo = this.searchlist.batchNo || undefined;
      searchparam.dataTypeId = this.searchlist.dataTypeId || undefined;
      searchparam.dataItemId = this.searchlist.dataItemId || undefined;
      searchparam.alarmTypeId = this.searchlist.alarmTypeId || undefined;
      searchparam.facilityNo = this.searchlist.facilityNo || undefined;
      let params = {
        page: this.currentPage,
        size: this.pageSize,
        entity: {
          ...searchparam,
          simpleEntity: false
        },
        sortList: this.sortList || [],
      };
      this.entity = params.entity;
      nowpagereq.getlist(params).then((res) => {
        this.loading = false;
        if (res.code === 0) {
          this.$message.error("当前告警历史表格获取失败");
        }
        let data = res.data.content;
        // 赋值总条数
        this.totalSize = res.data.totalElements;
        // 赋值数组
        this.tableData = data;
        this.addblankmet();
        this.resetActionBar();
      });
    },
    // 获取当前拥有类型表格
    getTableDataList() {
      // 拦截表格数据请求
      if (this.nowselecttype === 1) {
        this.getTableDataListtwo();
        return;
      }
      this.loading = true;
      let searchparam = {};
      if (this.searchlist.date && this.searchlist.date[0]) {
        searchparam.startTime = this.dateToFormat(this.searchlist.date[0]);
      }
      if (this.searchlist.date && this.searchlist.date[1]) {
        searchparam.endTime = this.dateToFormat(this.searchlist.date[1]);
      }
      // searchparam.dataTypeId = this.searchlist.dataTypeId
      searchparam.batchNo = this.searchlist.batchNo || undefined;
      searchparam.dataTypeId = this.searchlist.dataTypeId || undefined;
      searchparam.dataItemId = this.searchlist.dataItemId || undefined;
      searchparam.alarmTypeId = this.searchlist.alarmTypeId || undefined;
      searchparam.facilityNo = this.searchlist.facilityNo || undefined;
      let params = {
        page: this.currentPage,
        size: this.pageSize,
        entity: {
          ...searchparam,
          simpleEntity: false
        },
        sortList: this.sortList || [],
      };
      this.entity = params.entity;
      nowpagereq.getlist(params, false).then((res) => {
        this.loading = false;
        if (res.code === 0) {
          this.$message.error("当前告警历史表格获取失败");
        }
        let data = res.data.content;
        // 赋值总条数
        this.totalSize = res.data.totalElements;
        // 赋值数组
        this.tableData = data;
        this.addblankmet();
        this.resetActionBar();
      });
    },
    search() {
      this.currentPage = 1;
      this.getTableDataList();
    },
    changePageSize(pageSize) {
      this.pageSize = pageSize;
      this.getTableDataList();
    },
    changeCurrentPage(currentPage) {
      this.currentPage = currentPage;
      this.getTableDataList();
    },
    // TODO:批量处理
    disposed() {
      this.dialogVisible = true;
    },
    handleSelectionChange(list) {
      if (list.length > 0) {
        this.editLists = true;
        this.disposeFlag = false;
        this.disposeList = list;
        console.log(list, "list");
        //业务处理
      } else {
        this.disposeFlag = true;
        this.editLists = false;
      }
      console.log(this.editLists, "pi");
    },
    // 重置表格
    resetTable() {
      this.$refs.tableForm.clearSelection();
      this.formData.disposeContent = "";
    },
    cancel() {
      this.dialogVisible = false;
      this.templateContent = "";
      this.formData.disposeContent = "";
      this.resetTable();
    },
    // 查看设施列表
    lookFacilityList(row) {
      this.facilityBOList = row.facilityList;
      this.isShowEquip = true;
    },
    async download() {
      let params = {
        entity: {
          ...this.entity,
          organizationNo: sessionStorage.getItem("organizationNo"),
          farmingTypeNo: sessionStorage.getItem("farmingTypeNo"),
          system: "SC",
          disposeStatus: true,
        },
      };
      let url = "v3/alarm/alarmMessage/download";
      let excel = "历史告警记录表";
      this.downloadExcel(url, params, excel);
    },
  },
};
</script>
<style lang="scss" scoped>
.zhtabletitle {
  color: #31f7dd;
  margin-bottom: 10px;
}
.zhdialog {
  ::v-deep .el-textarea__inner {
    color: #0c0f0f;
  }
}
::v-deep .el-dialog__body {
  padding: 10px 10px 0px;
}
::v-deep .el-dialog__wrapper {
  .el-dialog {
    // width: 20% !important;
    // min-width: 20% !important;
    // margin-top: 10vh !important;
    .el-dialog__body {
      text-align: center;
    }
  }
}
::v-deep .tab-select {
  width: 100%;
  .butt-list-sty {
    position: absolute;
    left: 5px;
    top: 7px;
  }
}
</style>
